package Coding.Th;

/** 优先级  VIP VVIP VVVIP
 *
 * 1是最低的 10是最高的 默认是5
 *
 *
 */
public class ThreadPriority {

    public static void main(String[] args) {


//        new Thread("new Thread.start"){
//
//            @Override
//            public void run() {
//                for (int i = 0; i < 100; i++) {
//                    System.out.println(getName()+"");
//                }
//            }
//        }.start();


        Thread t1 = new Thread("t1"){
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(getName() + "");
                }
            }
        };



        Thread t2 = new Thread("t2"){

            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(getName()+"");
                }
            }
        };




        Thread t3 = new Thread("t3"){

            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println(getName()+"");
                }
            }
        };
        t1.start();
        t2.start();
        t3.start();
        t1.setPriority(Thread.MIN_PRIORITY);
        t3.setPriority(Thread.MAX_PRIORITY);

    }


}
